﻿using IOP.SgrA;
using IOP.SgrA.ECS;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
using IOP.Extension.DependencyInjection;

namespace VkSample102
{
    public class PlaneSystem : ComponentSystem
    {

        public override void Initialization()
        {
        }

        public override void Update(TimeSpan timeSpan)
        {
            ContextManager.Foreach<PlaneGroup>((group) =>
            {
                Context context = ContextManager.GetContext(group.Entity);
                ref MVPMatrix mvp = ref context.GetMVPMatrix();
                mvp.ModelMatrix = Matrix4x4.CreateScale(0.7f, 1.0f, 0.5f);
                context.PushToRenderGroup();
            });
            ContextManager.Foreach<NoDepthGroup>((group) =>
            {
                Context context = ContextManager.GetContext(group.Entity);
                ref MVPMatrix mvp = ref context.GetMVPMatrix();
                mvp.ModelMatrix = Matrix4x4.CreateScale(0.7f, 1.0f, 0.5f);
                context.PushToRenderGroup();
            });
        }
    }
}
